<admintpl file="header" />
<link href="__PUBLIC__/colpick/colpick.css" rel="stylesheet" type="text/css">
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li ><a href="{:U('Level/experlevel_index')}">等级列表</a></li>
			<li class="active"><a >编辑</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form" action="{:U('Level/experlevel_edit_post')}">
			<fieldset>
				<div class="control-group">
					<label class="control-label">等级</label>
					<div class="controls">
						<input type="text" name="levelid" value="{$experlevel['levelid']}">
						<input type="hidden" name="id" value="{$experlevel['id']}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">等级名称</label>
					<div class="controls">
						<input type="text" name="levelname" value="{$experlevel['levelname']}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">等级经验上限</label>
					<div class="controls">
						<input type="text" name="level_up" value="{$experlevel['level_up']}" maxlength="9">
						<span class="form-required">*</span>
					</div>
				</div>
                
                <div class="control-group">
					<label class="control-label">昵称颜色</label>
					<div class="controls">
						<input type="text" name="colour" id="picker" value="{$experlevel['colour']}"> <input id="colour_block" style="width:50px;height:20px;background:#{$experlevel['colour']};" disabled/>
						<span class="form-required">*</span> 内容为6位颜色16进制色码，点击可选择
					</div>
				</div>
                
                <div class="control-group">
					<label class="control-label">图标</label>
					<div class="controls">
                            <input type="hidden" name="thumb" id="thumb2" value="{$experlevel['thumb']}">
                            <a href="javascript:void(0);" onclick="flashupload('thumb_images', '附件上传','thumb2',thumb_images,'1,jpg|jpeg|gif|png|bmp,1,,,1','','','');return false;">
                                    <if condition="$experlevel['thumb'] neq ''">
                                                <img src="{$experlevel['thumb']}" id="thumb2_preview" width="50" style="cursor: hand" />
                                        <else/>
                                                <img src="__TMPL__Public/assets/images/default-thumbnail.png" id="thumb2_preview" width="50" style="cursor: hand" />
                                        </if>
                            </a>
                            <input type="button" class="btn btn-small" onclick="$('#thumb2_preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#thumb2').val('');return false;" value="取消图片"> 图片尺寸： 90 X 45
						<span class="form-required">*</span>
					</div>
				</div>    
                
                <div class="control-group">
					<label class="control-label">头像角标</label>
					<div class="controls">
                            <input type="hidden" name="thumb_mark" id="thumb3" value="{$experlevel['thumb_mark']}">
                            <a href="javascript:void(0);" onclick="flashupload('thumb_images', '附件上传','thumb3',thumb_images,'1,jpg|jpeg|gif|png|bmp,1,,,1','','','');return false;">
                                    <if condition="$experlevel['thumb_mark'] neq ''">
                                                <img src="{$experlevel['thumb_mark']}" id="thumb3_preview" width="40" style="cursor: hand" />
                                        <else/>
                                                <img src="__TMPL__Public/assets/images/default-thumbnail.png" id="thumb3_preview" width="40" style="cursor: hand" />
                                        </if>
                            </a>
                            <input type="button" class="btn btn-small" onclick="$('#thumb3_preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#thumb3').val('');return false;" value="取消图片"> 图片尺寸： 40 X 40
						<span class="form-required">*</span>
					</div>
				</div>                
	
			</fieldset>
			<div class="form-actions">
				<button type="submit" class="btn btn-primary js-ajax-submit">{:L('EDIT')}</button>
				<a class="btn" href="{:U('Level/experlevel_index')}">{:L('BACK')}</a>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>
    <script src="__PUBLIC__/colpick/colpick.js"></script>
    <script>
        (function(){
        $('#picker').colpick({
            layout:'hex',
            submit:0,
            colorScheme:'dark',
            onChange:function(hsb,hex,rgb,el,bySetColor) {
                $("#colour_block").css('background','#'+hex);
                // Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
                if(!bySetColor) $(el).val(hex);
            }

        }).keyup(function(){
            $(this).colpickSetColor(this.value);
        });
        })()
    </script>
</body>
</html>